/*
package cn.new18.testactivitytask.dragview;

import adw;

import android.content.Context;
import android.content.res.Resources;
import android.graphics.drawable.AnimationDrawable;
import android.text.TextUtils;
import android.util.AttributeSet;
import android.util.DisplayMetrics;
import android.view.LayoutInflater;
import android.view.MotionEvent;
import android.view.View.OnClickListener;
import android.widget.FrameLayout;
import android.widget.ImageView;
import android.widget.TextView;

import bdl;
import cjc;

import com.yy.a.Inject.InjectModel;
import com.yy.a.fe.widget.view.AsyncImageView;
import com.yy.a.sdk_module.model.channel.ChannelModel;

import dfn;

public class ChannelFloatView
        extends FrameLayout {
    public static int BOTTOM_LAYOUT_HEIGHT = 55;
    public static int TOP_LAYOUT_HEIGHT = 25;
    private int bottomEdge;
    private Context context;
    private float dX;
    private float dY;
    private int lastAction;
    private ImageView liveImg;
    private AsyncImageView mAvatar;
    @InjectModel
    private ChannelModel mChannelModel;
    private TextView mChannelName;
    private ImageView mClose;
    private View.OnClickListener mOnClickListener;
    private float rdXD;
    private float rdXM;
    private float rdYD;
    private float rdYM;
    private int screenH;
    private int screenW;
    private int statusBarHeight;
    private float tX;
    private float tY;
    private int topEdge;

    public ChannelFloatView(Context paramContext) {
        this(paramContext, null);
    }

    public ChannelFloatView(Context paramContext, AttributeSet paramAttributeSet) {
        this(paramContext, paramAttributeSet, 0);
    }

    public ChannelFloatView(Context paramContext, AttributeSet paramAttributeSet, int paramInt) {
        super(paramContext, paramAttributeSet, paramInt);
        this.context = paramContext;
        bdl.a(this);
        d();
        a();
        c();
    }

    private void a() {
        ((LayoutInflater) getContext().getSystemService("layout_inflater")).inflate(2130903321, this);
        this.mAvatar = ((AsyncImageView) findViewById(2131625109));
        this.mChannelName = ((TextView) findViewById(2131625111));
        this.mClose = ((ImageView) findViewById(2131625112));
        this.liveImg = ((ImageView) findViewById(2131625110));
        b();
    }

    private void b() {
        this.liveImg.setImageResource(2130837581);
        ((AnimationDrawable) this.liveImg.getDrawable()).start();
    }

    private void c() {
        this.mClose.setOnClickListener(new cjc(this));
    }

    private void d() {
        this.topEdge = dfn.a(TOP_LAYOUT_HEIGHT);
        this.bottomEdge = dfn.a(BOTTOM_LAYOUT_HEIGHT);
        DisplayMetrics localDisplayMetrics = getContext().getResources().getDisplayMetrics();
        this.screenH = localDisplayMetrics.heightPixels;
        this.screenW = localDisplayMetrics.widthPixels;
    }

    public boolean onTouchEvent(MotionEvent paramMotionEvent) {
        switch (paramMotionEvent.getActionMasked()) {
            default:
                return false;
            case 0:
                this.dX = (getX() - paramMotionEvent.getRawX());
                this.dY = (getY() - paramMotionEvent.getRawY());
                this.rdXD = paramMotionEvent.getRawX();
                this.rdYD = paramMotionEvent.getRawY();
                this.lastAction = 0;
        }
        for (; ; ) {
            return true;
            this.tY = (paramMotionEvent.getRawY() + this.dY);
            this.tX = (paramMotionEvent.getRawX() + this.dX);
            if ((this.tY > this.topEdge + this.statusBarHeight) && (this.tY + getHeight() < this.screenH - this.bottomEdge - this.statusBarHeight)) {
                setY(this.tY);
                label164:
                if ((this.tX <= 0.0F) || (this.tX + getWidth() >= this.screenW)) {
                    break label452;
                }
                setX(this.tX);
            }
            for (; ; ) {
                this.rdXM = (paramMotionEvent.getRawX() - this.rdXD);
                this.rdYM = (paramMotionEvent.getRawY() - this.rdYD);
                if (Math.abs(this.rdXM) + Math.abs(this.rdXM) > 16.0F) {
                    this.lastAction = 2;
                }
                adw.b("TAG", "onTouchEvent: " + this.rdXM);
                adw.b("TAG", "onTouchEvent: " + this.rdXM);
                adw.b("TAG", "onTouchEvent: " + (Math.abs(this.rdXM) + Math.abs(this.rdXM)));
                break;
                if (this.tY <= this.topEdge + this.statusBarHeight) {
                    setY(this.topEdge + this.statusBarHeight);
                    break label164;
                }
                if (this.tY + getHeight() < this.screenH - this.bottomEdge - this.statusBarHeight) {
                    setY(this.tY);
                    break label164;
                }
                setY(this.screenH - getHeight() - this.bottomEdge - this.statusBarHeight);
                break label164;
                label452:
                if (this.tX <= 0.0F) {
                    setX(0.0F);
                } else if (this.tX + getWidth() < this.screenW) {
                    setX(this.tX);
                } else {
                    setX(this.screenW - getWidth());
                }
            }
            if ((this.lastAction == 0) && (this.mOnClickListener != null)) {
                this.mOnClickListener.onClick(this);
            }
            this.rdXD = 0.0F;
            this.rdYD = 0.0F;
        }
    }

    public void setMyOnClickListener(View.OnClickListener paramOnClickListener) {
        this.mOnClickListener = paramOnClickListener;
    }

    public void setStatusBarHeight(int paramInt) {
        this.statusBarHeight = paramInt;
    }

    public void updateChannelInfo(String paramString) {
        if (TextUtils.isEmpty(paramString)) {
            this.mChannelModel.r();
            return;
        }
        this.mChannelName.setText(paramString);
    }

    public void updateTeacherInfo(String paramString1, String paramString2) {
        if (TextUtils.isEmpty(paramString2)) {
            this.mChannelModel.r();
            return;
        }
        if (TextUtils.isEmpty(paramString1)) {
            this.mAvatar.setImage(2130839234);
        }
        for (; ; ) {
            this.mChannelName.setText(paramString2);
            return;
            this.mAvatar.setImageUrl(paramString1);
        }
    }
}
*/
